/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.order.entity;


import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wealth.commodity.entity.Goods;
import com.wealth.member.entity.Member;

/**
 * 代金券购买记录
 * @author chan
 *
 */
@Entity
@Table(name = "t_order_voucher_record")
public class VoucherRecord implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private Order order;
	private Member member;
	private Goods goods;
	private String code;
	private Integer status;
	private Date createTime;
	
	
	/* ---------------- method ----------------*/
	
	public VoucherRecord(){
	}

	public VoucherRecord(Long id){
		this.id = id;
	}

	/* ---------------- getter/setter ----------------*/
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@ManyToOne
	@JoinColumn(name="goods_id")
	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}
	@ManyToOne
	@JoinColumn(name="order_id")
	@JsonIgnore
	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	@ManyToOne
	@JoinColumn(name="member_id")
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@Column(name="create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	
}



